using System;
using System.Collections;
using System.Data;

namespace SistemaLib.sipe.db.general
{
	/// <summary>
	/// Summary description for DbParameterCollection.
	/// </summary>
	public class DbParameterCollection : CollectionBase, IDisposable
	{
		public DbParameterCollection()
		{

		}

		public DbParameterCollection(params IDbDataParameter [] parameters)
		{
			foreach(IDbDataParameter param in parameters)
			{
				this.Add(param);
			}
		}

		public void Dispose()
		{
		}

		public virtual bool IsSynchronized
		{
			get { return false; }
		}

		public virtual object SyncRoot
		{
			get { return List.SyncRoot; }
		}

		public virtual void CopyTo(IDbDataParameter[] array, int index)
		{
			
			List.CopyTo(array, index);
		}

		public virtual bool IsFixedSize
		{
			get { return false; }
		}
			
		public virtual bool IsReadOnly
		{
			get { return false; }
		}

		public virtual IDbDataParameter this[int index]
		{
			get { return (IDbDataParameter)(List[index]); }
			set { List[index] = value; }
		}

		public virtual IDbDataParameter Add(IDbDataParameter param)
		{
			List.Add(param);
			return param;
		}

		public virtual bool Contains(IDbDataParameter param)
		{
			return List.Contains(param);
		}

		public virtual int IndexOf(IDbDataParameter param)
		{
			return List.IndexOf(param);
		}
			
		public virtual void Insert(int index, IDbDataParameter param)
		{
			List.Insert(index, param);
		}

		public virtual void Remove(IDbDataParameter param)
		{
			List.Remove(param);
		}

		protected override void OnClear()
		{
			this.Dispose();
			base.OnClear();
		}
	}
}
